load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
    name = "aws",
    srcs = [
        "aws.go",
        "config.go",
        "keys.go",
        "support.go",
    ],
    embedsrcs = [
        "config.json",
        "old.json",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/roachprod/vm/aws",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/roachprod/config",
        "//pkg/roachprod/logger",
        "//pkg/roachprod/vm",
        "//pkg/roachprod/vm/flagstub",
        "//pkg/util/retry",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_spf13_pflag//:pflag",
        "@org_golang_x_sync//errgroup",
        "@org_golang_x_time//rate",
    ],
)

genrule(
    name = "gen-main-tf",
    outs = ["terraform/main.tf"],
    cmd = """
      $(location //pkg/roachprod/vm/aws/terraformgen) -o $@
    """,
    tools = ["//pkg/roachprod/vm/aws/terraformgen"],
    visibility = [
        ":__pkg__",
        "//pkg/gen:__pkg__",
    ],
)
